﻿#include "mythread.h"



myThread::myThread(QTcpSocket *s, QObject *parent) : QThread(parent)
{
    socket = s;
}

void myThread::run()
{
    //谁发出信号: socket,但是socket是局部变量,所以加一个myThread构造函数
    connect(socket,&QTcpSocket::readyRead,this, &myThread::clientInfoSlots);
}

void myThread::clientInfoSlots()
{
    QByteArray ba  = socket->readAll();
    qDebug() << ba;

    emit sendToWidget(ba);
}
